Skip to content

test(ltc): AutoRatchet sim + desired-version tally KATs (G2) - #676

Merged
frstrtr merged 2 commits into
masterfrom
ltc-doge/ltc-desired-version-tally-kat
Jul 12, 2026
Merged

test(ltc): AutoRatchet sim + desired-version tally KATs (G2)#676
frstrtr merged 2 commits into
masterfrom
ltc-doge/ltc-desired-version-tally-kat

Conversation

@frstrtr

@frstrtr frstrtr commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Ports the LTC-side G2 AutoRatchet coverage that dgb already carries.

  • desired-version tally KAT via real ShareTracker API (0c8a83a)
  • AutoRatchet staged-migration SIM KAT incl. inline work-weighted tail-guard replica (5fb702b)

Covers: 95%-by-count activation window, 60%-by-work accept/tail gate boundaries (59/60/61 + empty/zero-total), mint-cannot-outrun-accept, staged monotonic tally, state-persist-across-restart, fresh-node baseline.

Evidence: share_test built fresh from source, 13/13 PASS (6 LtcDesiredVersionTally + 7 LTC_AutoRatchetSim), Linux x86_64. No production code touched — test-only.

Reviewer-authored; I do not merge.

frstrtr added 2 commits July 12, 2026 11:09
LTC is the V36 reference impl but, unlike dgb, does not modularize the
desired-version tally into src/impl/ltc/coin/. The accumulation lives
inline in ShareTracker::get_desired_version_weights (the consensus
60%-by-work switch gate input, share_check step 2 / AutoRatchet tail
guard) and its flat-count diagnostic sibling get_desired_version_counts
(share_tracker.hpp:2150/:2179). This KAT drives the tally through the
real chain-walk API: it builds a resolved ltc::ShareTracker of V36
MergedMiningShare and asserts both per-version maps against the p2pool
data.py:2651 oracle (res[dv] += target_to_average_attempts(share.target)).

Non-circular: a work-definition anchor pins chain::target_to_average_attempts
to hand-derived constants over 2^k-1 targets; the tracker-tally
expectations are re-derived by an independent accumulation applying the
same production primitive to the input bits, not read from the maps
under test. Covers empty/absent tip, single/repeated/multi-version
bucketing, the work-weight-inverts-flat-count case, and the lookbehind
clamp. Additive: joins the existing share_test target; no production
code touched.
Port the dgb AutoRatchet sim/tail-guard coverage to LTC, adapted to LTCs
2-arg ctor (baseline derived inline as target-1) and single-algo Scrypt
posture (drops dgbs multi-algo C5). 7 cases through the real ltc::AutoRatchet
+ ltc::ShareTracker API: thresholds, C2 VOTING-mints-v35-baseline,
C3 60%-by-work gate + mint-cannot-outrun-accept + monotonic staged tally,
C4 CONFIRMED restart-persistence. Arms ltc_g2_crossing_staged_migration
harness rig-free. Joins share_test (build allowlist). FENCED, additive.
@frstrtr
frstrtr merged commit 12de90f into master Jul 12, 2026
31 of 32 checks passed
@frstrtr
frstrtr deleted the ltc-doge/ltc-desired-version-tally-kat branch July 12, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant